\hypertarget{classduye_1_1_tcp_server_if}{\section{duye\-:\-:Tcp\-Server\-If Class Reference}
\label{classduye_1_1_tcp_server_if}\index{duye\-::\-Tcp\-Server\-If@{duye\-::\-Tcp\-Server\-If}}
}


tcp service interface  




{\ttfamily \#include $<$duye\-\_\-tcp\-\_\-server.\-h$>$}

\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
virtual bool \hyperlink{classduye_1_1_tcp_server_if_a33198fbb280dfb1edd4ba5f9c511d092}{on\-Newcon} (const \hyperlink{classduye_1_1_i_pv4_addr}{I\-Pv4\-Addr} \&client\-Addr, const int32 client\-Sockfd)=0
\begin{DoxyCompactList}\small\item\em accept client to connect \end{DoxyCompactList}\item 
virtual bool \hyperlink{classduye_1_1_tcp_server_if_a2a6bf58f6fa4c307c6d4e984c46853d8}{on\-Discon} (const int32 client\-Sockfd)=0
\begin{DoxyCompactList}\small\item\em disconnect \end{DoxyCompactList}\item 
virtual bool \hyperlink{classduye_1_1_tcp_server_if_ad55bacb95c203de6b222a2603bd74710}{on\-Recved} (const int32 client\-Sockfd, const int8 $\ast$data, const uint64 len)=0
\begin{DoxyCompactList}\small\item\em receive data \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
tcp service interface 

\subsection{Member Function Documentation}
\hypertarget{classduye_1_1_tcp_server_if_a2a6bf58f6fa4c307c6d4e984c46853d8}{\index{duye\-::\-Tcp\-Server\-If@{duye\-::\-Tcp\-Server\-If}!on\-Discon@{on\-Discon}}
\index{on\-Discon@{on\-Discon}!duye::TcpServerIf@{duye\-::\-Tcp\-Server\-If}}
\subsubsection[{on\-Discon}]{\setlength{\rightskip}{0pt plus 5cm}virtual bool duye\-::\-Tcp\-Server\-If\-::on\-Discon (
\begin{DoxyParamCaption}
\item[{const int32}]{client\-Sockfd}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [pure virtual]}}}\label{classduye_1_1_tcp_server_if_a2a6bf58f6fa4c307c6d4e984c46853d8}


disconnect 


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt out}  & {\em client\-Sockfd} & \-: client sockfd \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
true/false 
\end{DoxyReturn}
\hypertarget{classduye_1_1_tcp_server_if_a33198fbb280dfb1edd4ba5f9c511d092}{\index{duye\-::\-Tcp\-Server\-If@{duye\-::\-Tcp\-Server\-If}!on\-Newcon@{on\-Newcon}}
\index{on\-Newcon@{on\-Newcon}!duye::TcpServerIf@{duye\-::\-Tcp\-Server\-If}}
\subsubsection[{on\-Newcon}]{\setlength{\rightskip}{0pt plus 5cm}virtual bool duye\-::\-Tcp\-Server\-If\-::on\-Newcon (
\begin{DoxyParamCaption}
\item[{const {\bf I\-Pv4\-Addr} \&}]{client\-Addr, }
\item[{const int32}]{client\-Sockfd}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [pure virtual]}}}\label{classduye_1_1_tcp_server_if_a33198fbb280dfb1edd4ba5f9c511d092}


accept client to connect 


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt out}  & {\em client\-Addr} & \-: output client address information \\
\hline
\mbox{\tt out}  & {\em client\-Sockfd} & \-: client sockfd \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
true/false 
\end{DoxyReturn}
\hypertarget{classduye_1_1_tcp_server_if_ad55bacb95c203de6b222a2603bd74710}{\index{duye\-::\-Tcp\-Server\-If@{duye\-::\-Tcp\-Server\-If}!on\-Recved@{on\-Recved}}
\index{on\-Recved@{on\-Recved}!duye::TcpServerIf@{duye\-::\-Tcp\-Server\-If}}
\subsubsection[{on\-Recved}]{\setlength{\rightskip}{0pt plus 5cm}virtual bool duye\-::\-Tcp\-Server\-If\-::on\-Recved (
\begin{DoxyParamCaption}
\item[{const int32}]{client\-Sockfd, }
\item[{const int8 $\ast$}]{data, }
\item[{const uint64}]{len}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [pure virtual]}}}\label{classduye_1_1_tcp_server_if_ad55bacb95c203de6b222a2603bd74710}


receive data 


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt out}  & {\em client\-Sockfd} & \-: client sockfd \\
\hline
\mbox{\tt out}  & {\em data} & \-: received data \\
\hline
\mbox{\tt in}  & {\em len} & \-: received data length \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
true/false 
\end{DoxyReturn}
\begin{DoxyNote}{Note}

\end{DoxyNote}


The documentation for this class was generated from the following file\-:\begin{DoxyCompactItemize}
\item 
Z\-:/duye/src/duyebase/net/\hyperlink{duye__tcp__server_8h}{duye\-\_\-tcp\-\_\-server.\-h}\end{DoxyCompactItemize}
